package c99其他测试;

import java.io.File;

/**
 * <p>
 *
 * @author: yuanwl
 * @date: 2021/7/1 22:13
 */
public class RefactorProject {

    private static final String SRC_NAME = "zysys";
    private static final String DST_NAME = "zyxt";

    public static void main(String[] args) {
        File proj = new File("/Volumes/APFS/Projects/ghzq-zysys");
        refactor(proj);
    }

    private static void refactor(File file) {
        if (file.getName().contains(SRC_NAME)) {
            file.renameTo(new File(file.getAbsolutePath().replaceAll(SRC_NAME, DST_NAME)));
        }
        if (file.isDirectory()) {
            for (File f : file.listFiles()) {
                refactor(f);
            }
        }
    }

}
